function box_info(){
	$(window.parent.document).find("#fancybox-wrap").height(180).width(300);
	$(window.parent.document).find("#fancybox-content").height(180).width(300);
	$(window.parent.document).find("#fancybox-overlay").height($(window.parent.document).height());
	position();
}
function box_auto(){
	var width = $(".view").width();
	var height = $(".view").height();
	$(window.parent.document).find("#fancybox-wrap").height(height+100).width(width+100);
	$(window.parent.document).find("#fancybox-content").height(height+100).width(width+100);
	$(window.parent.document).find("#fancybox-overlay").height($(window.parent.document).height());
	//position();
}
//动态改变iframe的高度
function autoHeight(is_document){
	var content_height =0;
	if(is_document){
		content_height = $(document).height();
	}else{
		content_height = $(document).contents().find(".G-showBox").height();
	}
	$(window.parent.document).find("#fancybox-wrap").height(content_height);
	$(window.parent.document).find("#fancybox-content").height(content_height);
	$(window.parent.document).find("#fancybox-overlay").height($(window.parent.document).height());
}
//动态改变iframe的宽度
function autoWidth(is_document){
	var content_width = 0;
	if(is_document){
		content_width = $(document).width();
	}else{
		content_width = $(document).contents().find(".G-showBox").width();
	}
	
	$(window.parent.document).find("#fancybox-wrap").width(content_width + 100);
	$(window.parent.document).find("#fancybox-content").width(content_width + 100);
}
//获得iframe内容的高度
function getIframeHeight(){
	return $(document).height();
}
//获得iframe内容的宽度
function getIframeWidth(){
	return $(document).width();
}
//获得文档的可见高度
function getAvailHeight(){
	return $(window).height();
}
//获得文档的可见宽度
function getAvailWidth(){
	return $(window).width();
}
function position(){
	var el = $(window.parent.document).find("#fancybox-wrap");
	var width = $(window.parent.document).width();
	var height = $(window.parent.document).height();
	var el_width = el.width();
	var el_height = el.height();
	if(width != null && height == null){
		width = (width - el_width)/2;
		el.offset({left:width-20});
	}
	if(height != null && width == null){
		height = (height - el_height)/2;
		el.offset({top:height});
	}
	if(height != null && width != null){
		width = (width - el_width)/2;
		height = (height - el_height)/2;
		el.offset({top:height, left:width});
	}
}
function xheditorHeight(){
	var now_height = $(document).find("iframe[id$='_iframe']").contents().height();
	$(document).find(".xheIframeArea").height(now_height);
	$(document).scrollTop($(document).scrollTop()+now_height);
}